import threading
import time , os , sys

sys.path.append("lib/log") 
sys.path.append("lib/db") 
sys.path.append("lib/io/in")
sys.path.append("lib/io/out")
sys.path.append("lib/comum") 
sys.path.append("processamento") 


from log import Log
from principal import Principal

global sono
#sono=60
#sono=10
sono=5	
	
class ThreadPrincipal ( threading.Thread ):

	def run ( self ):
		log = Log()
		log.update('**GdpLivre 2014 - Generic Data Processing Started!**\n')
		proc = Principal()
		while True:
			log.update('['+ self.getName()+ '][principal] executando...\n')
			proc.run()
			log.update('['+ self.getName()+ '][principal] dormindo...\n\n\n')
			time.sleep(sono)
# local test
"""
t = ThreadPrincipal ()
t.start()
"""
